//package org.arch_learn.netty_rpc.consumer.config;
//
//import org.arch_learn.netty_rpc.consumer.interceptor.RequestCountInterceptor;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//import java.util.concurrent.atomic.AtomicInteger;
//
//@Configuration
//public class MvcConfig implements WebMvcConfigurer {
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(new RequestCountInterceptor(requestCount()))
//                .addPathPatterns("/**");
//    }
//
//    @Bean
//    public AtomicInteger requestCount() {
//        return new AtomicInteger(0);
//    }
//}
